<?php
echo $this->render('picture/special/_tab.phtml');
$this->headScript()->appendFile(_STATIC_HTTP . '/admin/js/_ajax.js');
?>
<?php $this->headScript()->captureStart();?>
$(document).ready(function(){
	_ajax.id = $('#photo-list');
	_ajax.name = 'photo';
	_ajax.form = $('form.ajaxForm');
	_ajax.loading = $('#photo-list').html();
	_ajax.url = '<?php echo $this->url('picture/ajax/specialAddPhoto');?>';
	_ajax.load();
});
<?php $this->headScript()->captureEnd();?>
<form action="" method="post" class="ajaxForm">
<?php echo $this->form()->hidden('referer', $this->referer) . "\n";?>
<div class="body">
	<table class="search">
		<tr>
			<th style="width:780px;"><?php echo $this->language('Add Photo To Special');?>:</th>
			<th></th>
		</tr>
		<tr>
			<td id="photo-list" class="center"><h1 style="padding:10px;"><?php echo $this->language('Loading')?>...</h1></td>
			<td>
				<table class="no-border form">	
					<tr>
						<td class="icon"><a href="<?php echo $this->row->getCover()->getLarge(false);?>" target="_blank"><img src="<?php echo $this->row->getCover()->getThumb(false);?>" /></a></td>
						<td>
							<h3 style="margin-bottom:5px;"><?php echo $this->escape($this->row->getLocale()->getTitle());?></h3>
							<strong>KEY: </strong><span class="red"><?php echo $this->row->getName();?></span>
							<p class="tags">
								<strong><?php echo $this->language('TAG');?>: </strong><?php 
								$tgs = array();
								foreach($this->row->getKeywords($this->row->getLocale()->getLang()) AS $tag) {
									$tgs[] = '<a href="#" onclick="return false;">' . $this->escape($tag) . '</a>';
								}
								echo implode(', ', $tgs);
								?>
							</p>
						</td>
						<td><h1><?php echo $this->row->getPtotal();?></h1><code>PHOTO(s)</code></td>
					</tr>
				</table>
				<hr/>
				<select name="photo_id[]" id="photo-id-x" style="width:100%;height:400px;" multiple="multiple"><?php 
				foreach($this->photoList AS $photo) {
					echo '<option value="' . $photo->getId() . '" selected="selected">';
					echo $photo->getTitle() . '</option>';
				}
				?></select></td>
		</tr>
		<tr>
			<td colspan="2">
				<button type="submit" name="submit" value="submit"><?php echo $this->language('Continue');?> »</button>
				<button type="button" name="cancel" value="cancel" onclick="history.back();"><?php echo $this->language('Cancel');?> »</button>
			</td>
		</tr>
	</table>
</div>
</form>
